package demo01;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @Description: 类作用描述
 * @Author: ChenZhiXiang
 * @CreateDate: 2019/5/8 0008 10:58
 * @Version: 1.0
 */
public class Demo01Main {

    public static void main(String[] args) {
        // 加载配置
        ApplicationContext context = new AnnotationConfigApplicationContext(AopConfig.class);
        // 获取bean
        DemoAnnoationService demoAnnoationService = (DemoAnnoationService) context.getBean("demoAnnoationService");
        DemoMethodService demoMethodService = (DemoMethodService) context.getBean("demoMethodService");
        // 调用
        demoAnnoationService.add();
        demoMethodService.add();
        ((AnnotationConfigApplicationContext) context).close();
    }

}
